package com.xxl.job.executor.synchronizeData.handleOne.dataProcessing.job;

import cn.hutool.core.util.ObjectUtil;
import com.xxl.job.core.context.XxlJobHelper;
import com.xxl.job.core.handler.annotation.XxlJob;
import com.xxl.job.executor.synchronizeData.handleOne.dataProcessing.executor.synDataHandleOneExecutor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author hanyq
 * @date 2023/11/1 17:46
 */
@Slf4j
@Component
public class synDataHandleOne {
    @Resource
    private synDataHandleOneExecutor executor;

    @XxlJob("synDataHandleOneJob")
    public void doJobHandler(){
        log.info("同步数据操作One开始===========================================.");
        Boolean full = null;
        String param = XxlJobHelper.getJobParam();
        if (ObjectUtil.isNotEmpty(param)) {
            XxlJobHelper.log("接收到参数：" + param);
        }
        if ("full".equals(param)) {
            full = true;
        }
        if (null == full) {
            full = false;
        }
        executor.handler(full);

        log.info("同步数据操作One结束===========================================.");
    }
}
